package site.timers.game;

import java.util.ArrayList;
import java.util.List;

public class Inventory {
    private List<Item> items;
    private int capacity;
    
    public Inventory(int capacity) {
        this.items = new ArrayList<>();
        this.capacity = capacity;
    }
    
    public boolean addItem(Item item) {
        if (items.size() < capacity) {
            items.add(item);
            return true;
        }
        return false;
    }
    
    public void removeItem(Item item) {
        items.remove(item);
    }
    
    public List<Item> getItems() {
        return new ArrayList<>(items);
    }
    
    public int getCapacity() {
        return capacity;
    }
}